package com.fishery.order.service.client;

import com.fishery.entity.Result;
import com.fishery.order.entity.client.OrderVo;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author run 、 ghost
 * @since 2021/2/1 11:24
 */
@Component
@FeignClient(value = "fishery-nlogistics-service")
public interface LogisticsClient {

	/**
	 * 创建物流订单
	 * @param orderVo
	 * @return
	 */
	@PostMapping("/logistics/order/")
	public Result createLogisticOrder(@RequestBody @ApiParam(required = true,value = "orderVo") OrderVo orderVo);

	@GetMapping("/logistics/order/{id}")
	public Result getOrderById(@PathVariable(value = "id") String orderId);

	@ApiOperation("根据物流订单id获取物流路径")
	@GetMapping("/logistics/path/{id}")
	public Result getPathOfLogisticsId(@PathVariable(value = "id") String logisticsId);
}
